﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Ecreate.Web.usercontrol
{
    public partial class ucLuckList : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //<ul class="newslist"><li><a title="新闻标题" href="../pages/NewsPage.aspx?id={0}">新闻标题</a></li></ul>
            //<li><a title="新闻标题" href="../pages/NewsPage.aspx?id={0}">新闻标题</a></li>
            string ul = "<ul>{0}</ul>";
            string li = "<li class=\"blue\"><a title=\"{0}\" href=\"../pages/LuckList.aspx?id={1}\">{0}</a></li>";
            //0:新闻标题;1:id
            string sql = "select top 6 * from t_luck_info";
            System.Data.DataTable dt = GG.GetTable(sql);
            string items = "";
            foreach (System.Data.DataRow dr in dt.Rows)
            {
                string s0 = dr["luck_name"].ToString() + " - " + dr["luck_tel"].ToString();
                string s1 = dr["id"].ToString();
                items += string.Format(li, new string[] { s0, s1 });
            }
            Literal1.Text = string.Format(ul, new string[] { items });
        }
    }
}